#ifndef MEDICALSERVER_H
#define MEDICALSERVER_H

#include <QTcpServer>
#include <QList>
#include "clienthandler.h"

class MedicalServer : public QTcpServer {
    Q_OBJECT
public:
    explicit MedicalServer(QObject *parent = nullptr);
    ~MedicalServer();
    
    bool startServer(const QString& host, quint16 port);
    void stopServer();
    
protected:
    void incomingConnection(qintptr socketDescriptor) override;
    
private slots:
    void onClientDisconnected(ClientHandler* client);
    
private:
    QList<ClientHandler*> m_clients;
};

#endif // MEDICALSERVER_H

